package com.woniuxy.controller;

import com.woniuxy.entity.Dept;
import com.woniuxy.entity.Emp;
import com.woniuxy.service.DeptService;
import com.woniuxy.util.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("dept")
public class DeptController {
    @Autowired
    private DeptService deptService;

    @PostMapping("save")
    public ResultVo save(@RequestBody Dept dept){
        int rows = deptService.save(dept);
        return rows > 0 ?ResultVo.success() : ResultVo.failure();
    }
}
